The STRMESSAGE function returns the text of the error message specified by Err. This function is especially useful in conjunction with the CODE field of the !ERROR_STATE system variable which always contains the error number of the last error. The MSG field of the !ERROR_STATE system variable contains the text of the last error message.
Result = STRMESSAGE( Err [, /BLOCK | , /CODE | , /NAME] )
Returns the error message text.
The error number or text. Programs must not make the assumption that certain error numbers are always related to certain error messages—the actual correspondence changes over time as IDL is modified.
Set this keyword to return the name of the message block that defines Err. If this keyword is specified, Err must be an error code.
Set this keyword to return the error code for the error message specified in Err. If this keyword is specified, Err must be an error name.
Set this keyword to return a string containing the error message that goes with Err. If this keyword is specified, Err must be an error code.
Print the error message associated with error number 4 by entering:
PRINT, STRMESSAGE(4)
Original |
Introduced |